# -*- coding: utf-8 -*-

<%page cached="True" cache_type="memory" cache_key="${c.cache_key}"/>
## TODO: invalidate the cache for the given keys when necessary.

<%inherit file="../base.mako"/>

<%namespace name="student_comps" file="/students/components.mako"/>
<%namespace name="room_comps" file="/rooms/components.mako"/>
<%namespace name="building_comps" file="/buildings/components.mako"/>

<h1>
Rooms
</h1>

<table>
	<tr>
		<th>Room</th>
		<th>Building</th>
		<th>Student</th>
	</tr>
%for room in c.rooms_q.all():
	<tr>
	    <td>
	    	${room_comps.link_to(room)}
		</td>
		<td>
			${building_comps.link_to(room.building)}
		</td>
		<td>
			${student_comps.link_to(room.user)}
		</td>
	</tr>
%endfor
</table>